package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.Lsh精品分类Model;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by ThinkPad on 2016/9/20
 */
@Transactional
public interface Lsh精品分类Repository extends JpaRepository<Lsh精品分类Model, Integer>, JpaSpecificationExecutor<Lsh精品分类Model> {

    @Query("select a from Lsh精品分类Model a where a.种类编号=?1 and a.产品分类=?2")
    Lsh精品分类Model getIdBy种类编号And产品分类(int productTypeId, String 产品分类);


    @Query("select a from Lsh精品分类Model a where a.shoptypeid =?1 and a.soleshopid =?2")
    List<Lsh精品分类Model> getIdBytwobrother(String productTypeId, String 产品分类);

    @Query("select a from Lsh精品分类Model a where a.shoptypeid =?1")
    List<Lsh精品分类Model> getIdBytwobrothershoptypeid(String productTypeId);

    @Query("select a from Lsh精品分类Model a where a.soleshopid =?1 ")
    List<Lsh精品分类Model> getIdBytwobrothersoleshopid(String productTypeId);
}
